{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Linear regression from scratch\n",
    "\n",
    "Powerful ML libraries can eliminate repetitive work, but if you rely too much on abstractions, you might never learn how neural networks really work under the hood. So for this first example, let's get our hands dirty and build everything from scratch, relying only on autograd and NDArray. First, we'll import the same dependencies as in the [autograd chapter](../chapter01_crashcourse/autograd.ipynb). We'll also import the powerful `gluon` package  but in this chapter, we'll only be using it for data loading."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from __future__ import print_function\n",
    "import mxnet as mx\n",
    "from mxnet import nd, autograd, gluon\n",
    "mx.random.seed(1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Set the context\n",
    "\n",
    "We'll also want to specify the contexts where computation should happen. This tutorial is so simple that you could probably run it on a calculator watch. But, to develop good habits we're going to specify two contexts: one for data and one for our models. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "data_ctx = mx.cpu()\n",
    "model_ctx = mx.cpu()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Linear regression\n",
    "\n",
    "\n",
    "To get our feet wet, we'll start off by looking at the problem of regression.\n",
    "This is the task of predicting a *real valued target* $y$ given a data point $x$.\n",
    "In linear regression, the simplest and still perhaps the most useful approach,\n",
    "we assume that prediction can be expressed as a *linear* combination of the input features \n",
    "(thus giving the name *linear* regression):\n",
    "\n",
    "$$\\hat{y} = w_1 \\cdot x_1 + ... + w_d \\cdot x_d + b$$\n",
    "\n",
    "\n",
    "Given a collection of data points $X$, and corresponding target values $\\boldsymbol{y}$, \n",
    "we'll try to find the *weight* vector $\\boldsymbol{w}$ and bias term $b$ \n",
    "(also called an *offset* or *intercept*)\n",
    "that approximately associate data points $\\boldsymbol{x}_i$ with their corresponding labels ``y_i``. \n",
    "Using slightly more advanced math notation, we can express the predictions $\\boldsymbol{\\hat{y}}$\n",
    "corresponding to a collection of datapoints $X$ via the matrix-vector product:\n",
    "\n",
    "$$\\boldsymbol{\\hat{y}} = X \\boldsymbol{w} + b$$\n",
    "\n",
    "\n",
    "Before we can get going, we will need two more things \n",
    "\n",
    "* Some way to measure the quality of the current model  \n",
    "* Some way to manipulate the model to improve its quality\n",
    "\n",
    "\n",
    "### Square loss\n",
    "In order to say whether we've done a good job, \n",
    "we need some way to measure the quality of a model. \n",
    "Generally, we will define a *loss function*\n",
    "that says *how far* are our predictions from the correct answers.\n",
    "For the classical case of linear regression, \n",
    "we usually focus on the squared error.\n",
    "Specifically, our loss will be the sum, over all examples, of the squared error $(y_i-\\hat{y})^2$ on each:\n",
    "\n",
    "$$\\ell(y, \\hat{y}) = \\sum_{i=1}^n (\\hat{y}_i-y_i)^2.$$\n",
    "\n",
    "\n",
    "For one-dimensional data, we can easily visualize the relationship between our single feature and the target variable. It's also easy to visualize a linear predictor and it's error on each example. \n",
    "Note that squared loss *heavily penalizes outliers*. For the visualized predictor below, the lone outlier would contribute most of the loss.\n",
    "\n",
    "![](../img/linear-regression.png)\n",
    "\n",
    "\n",
    "### Manipulating the model\n",
    "\n",
    "For us to minimize the error,\n",
    "we need some mechanism to alter the model.\n",
    "We do this by choosing values of the *parameters*\n",
    "$\\boldsymbol{w}$ and $b$.\n",
    "This is the only job of the learning algorithm.\n",
    "Take training data ($X$, $y$) and the functional form of the model $\\hat{y} = X\\boldsymbol{w} + b$.\n",
    "Learning then consists of choosing the best possible $\\boldsymbol{w}$ and $b$ based on the available evidence.\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "### Historical note\n",
    "\n",
    "You might reasonably point out that linear regression is a classical statistical model.\n",
    "[According to Wikipedia](https://en.wikipedia.org/wiki/Regression_analysis#History), \n",
    "Legendre first developed the method of least squares regression in 1805,\n",
    "which was shortly thereafter rediscovered by Gauss in 1809. \n",
    "Presumably, Legendre, who had Tweeted about the paper several times,\n",
    "was peeved that Gauss failed to cite his arXiv preprint. \n",
    "\n",
    "![Legendre](../img/legendre.jpeg)\n",
    "\n",
    "\n",
    "Matters of provenance aside, you might wonder - if Legendre and Gauss \n",
    "worked on linear regression, does that mean there were the original deep learning researchers?\n",
    "And if linear regression doesn't wholly belong to deep learning, \n",
    "then why are we presenting a linear model \n",
    "as the first example in a tutorial series on neural networks? \n",
    "Well it turns out that we can express linear regression \n",
    "as the simplest possible (useful) neural network. \n",
    "A neural network is just a collection of nodes (aka neurons) connected by directed edges. \n",
    "In most networks, we arrange the nodes into layers with each feeding its output into the layer above. \n",
    "To calculate the value of any node, we first perform a weighted sum of the inputs (according to weights ``w``) \n",
    "and then apply an *activation function*. \n",
    "For linear regression, we only have two layers, one corresponding to the input (depicted in orange) \n",
    "and a one-node layer (depicted in green) corresponding to the ouput.\n",
    "For the output node the activation function is just the identity function.\n",
    "\n",
    "![](../img/onelayer.png)\n",
    "\n",
    "While you certainly don't have to view linear regression through the lens of deep learning, \n",
    "you can (and we will!).\n",
    "To ground the concepts that we just discussed in code, \n",
    "let's actually code up a neural network for linear regression from scratch.\n",
    "\n",
    "\n",
    "To get going, we will generate a simple synthetic dataset by sampling random data points ``X[i]`` and corresponding labels ``y[i]`` in the following manner. Our inputs will each be sampled from a random normal distribution with mean $0$ and variance $1$. Our features will be independent. Another way of saying this is that they will have diagonal covariance.  The labels will be generated accoding to the *true* labeling function `y[i] = 2 * X[i][0]- 3.4 * X[i][1] + 4.2 + noise` where the noise is drawn from a random gaussian with mean ``0`` and variance ``.01``. We could express the labeling function in mathematical notation as:\n",
    "$$y = X \\cdot w + b + \\eta, \\quad \\text{for } \\eta \\sim \\mathcal{N}(0,\\sigma^2)$$ \n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "num_inputs = 2\n",
    "num_outputs = 1\n",
    "num_examples = 10000\n",
    "\n",
    "def real_fn(X):\n",
    "    return 2 * X[:, 0] - 3.4 * X[:, 1] + 4.2\n",
    "    \n",
    "X = nd.random_normal(shape=(num_examples, num_inputs), ctx=data_ctx)\n",
    "noise = .1 * nd.random_normal(shape=(num_examples,), ctx=data_ctx)\n",
    "y = real_fn(X) + noise"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Notice that each row in ``X`` consists of a 2-dimensional data point and that each row in ``Y`` consists of a 1-dimensional target value. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "[-1.22338355  2.39233518]\n",
      "<NDArray 2 @cpu(0)>\n",
      "\n",
      "[-6.09602737]\n",
      "<NDArray 1 @cpu(0)>\n"
     ]
    }
   ],
   "source": [
    "print(X[0])\n",
    "print(y[0])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Note that because our synthetic features `X` live on `data_ctx` and because our noise also lives on `data_ctx`, the labels `y`, produced by combining `X` and `noise` in `real_fn` also live on `data_ctx`. \n",
    "We can confirm that for any randomly chosen point, \n",
    "a linear combination with the (known) optimal parameters \n",
    "produces a prediction that is indeed close to the target value"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "[-6.38070679]\n",
      "<NDArray 1 @cpu(0)>\n"
     ]
    }
   ],
   "source": [
    "print(2 * X[0, 0] - 3.4 * X[0, 1] + 4.2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can visualize the correspondence between our second feature (``X[:, 1]``) and the target values ``Y`` by generating a scatter plot with the Python plotting package ``matplotlib``. Make sure that ``matplotlib`` is installed. Otherwise, you may install it by running ``pip2 install matplotlib`` (for Python 2) or ``pip3 install matplotlib`` (for Python 3) on your command line. \n",
    "\n",
    "In order to plot with ``matplotlib`` we'll just need to convert ``X`` and ``y`` into NumPy arrays by using the `.asnumpy()` function. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAD8CAYAAAB0IB+mAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3W2QXOWVH/D/mdYF9YBDi3jKhRoJaV2UKGShmfWE1ZZS\nqaC1ETZGjMFYpsBxKq4oH0yVpaW0GWLXSuziQvEsFlXZzSbK2mWnpOBhDcyC5ZTAlraoKJbt0c4A\nkpFiYhtBw5pxUGPQNFJPz8mH6Tu63X3fuvvevm//X5VK0y8z/YxmdPq55znPeURVQURE6dcX9QCI\niKg3GPCJiDKCAZ+IKCMY8ImIMoIBn4goIxjwiYgyggGfiCgjGPCJiDKCAZ+IKCOWRD0Aqw9+8IO6\natWqqIdBRJQox48f/62qDng9L1YBf9WqVZicnIx6GEREiSIir/p5HlM6REQZ0XXAF5EVInJERH4u\nIidF5Mv1+68UkedE5Bf1v5d1P1wiIupUEDP8OQD3q+r1ADYA+JKIXA9gFMCPVPVaAD+q3yYiooh0\nHfBV9U1V/Yf6x+8CeBlAEcDtAL5Tf9p3AIx0+1pERNS5QHP4IrIKwBCAnwD4kKq+WX/oHwF8KMjX\nIiKi9gRWpSMilwN4AsB2Vf2diCw+pqoqIrYnrYjINgDbAGDlypVdjWFiqoSxQ6fxRrmC5YU8dm5e\ng5GhYldfk4goLQKZ4YuIgYVgf0BVn6zf/RsRuar++FUA3rL7XFXdp6rDqjo8MOBZRupoYqqEB558\nCaVyBQqgVK7ggSdfwsRUqeOvSUSUJkFU6QiAbwJ4WVW/YXnoaQBfqH/8BQB/1+1ruRk7dBqVaq3h\nvkq1hrFDp8N8WSKixAgipbMRwOcBvCQi0/X7/gOAPQAeF5EvAngVwGcDeC1Hb5Qrbd1PRJQ1XQd8\nVf1fAMTh4T/q9uv7tbyQR8kmuC8v5Hs1BCKi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g\n+agH0kxEcgD+CsAnAFwP4G4RuT7aUdn6NoBboh6ED3MA7lfV6wFsAPClGP57ngewSVXXAxgEcIuI\nbIh4TG6+DODldj+JAb8Nqvo7y83LAMRuAURVn1XVufrNYwCujnI8TlT1ZVU9HfU4HNwI4BVV/aWq\nXgDwXQC3RzymFqr6PIC3ox6HF1V9U1X/of7xu1gIVLHqZ6wL3qvfNOp/Yvf/GwBE5GoAtwL4m3Y/\nlwG/TSLyNRF5DcA9iOcM3+rfAPifUQ8igYoAXrPcfh0xC1BJJSKrAAwB+Em0I2lVT5NMA3gLwHOq\nGrsx1j0K4E8AzLf7iQz4TUTkhyJywubP7QCgql9R1RUADgC4L45jrD/nK1i4lD4QxRj9jpOyQ0Qu\nB/AEgO1NV8uxoKq1err2agA3ishHoh5TMxH5FIC3VPV4J5/PE6+aqOrHfD71AIAfANgV4nBseY1R\nRP41gE8B+CONsO62jX/LuCkBWGG5fXX9PuqQiBhYCPYHVPXJqMfjRlXLInIEC+sjcVsQ3whgi4h8\nEsBSAP9ERPar6r1+Ppkz/DaIyLWWm7cDOBXVWJyIyC1YuNzboqqzUY8noX4G4FoRWS0ilwD4HICn\nIx5TYomIAPgmgJdV9RtRj8eOiAyYFW0ikgfwccTw/7eqPqCqV6vqKiz8Xh72G+wBBvx27amnJF4E\ncDMWVsrj5i8BfADAc/Xy0f8S9YDsiMinReR1AH8I4KCIHIp6TKb6ovd9AA5hYYHxcVU9Ge2oWonI\nYwB+DGCNiLwuIl+MekwONgL4PIBN9d/J6foMNU6uAnCk/n/7Z1jI4bdV8pgE3GlLRJQRnOETEWUE\nAz4RUUYw4BMRZQQDPhFRRjDgExFlBAM+EVFGMOATEWUEAz4RUUb8fw+QjglvBwH4AAAAAElFTkSu\nQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7f9378417748>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "plt.scatter(X[:, 1].asnumpy(),y.asnumpy())\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Data iterators\n",
    "\n",
    "Once we start working with neural networks, we're going to need to iterate through our data points quickly. We'll also want to be able to grab batches of ``k`` data points at a time, to shuffle our data. In MXNet, data iterators give us a nice set of utilities for fetching and manipulating data. In particular, we'll work with the simple  ``DataLoader`` class, that provides an intuitive way to use an ``ArrayDataset`` for training models.\n",
    "\n",
    "\n",
    "We can load `X` and `y` into an ArrayDataset, by calling `gluon.data.ArrayDataset(X, y)`. It's ok for `X` to be a multi-dimensional input array (say, of images) and `y` to be just a one-dimensional array of labels. The one requirement is that they have equal lengths along the first axis, i.e., `len(X) == len(y)`. \n",
    "\n",
    "Given an `ArrayDataset`, we can create a DataLoader which will grab random batches of data from an `ArrayDataset`.  We'll want to specify two arguments. First, we'll need to say the `batch_size`, i.e., how many examples we want to grab at a time. Second, we'll want to specify whether or not to shuffle the data between iterations through the dataset. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "batch_size = 4\n",
    "train_data = gluon.data.DataLoader(gluon.data.ArrayDataset(X, y),\n",
    "                                   batch_size=batch_size, shuffle=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Once we've initialized our DataLoader (``train_data``), we can easily fetch batches by iterating over `train_data` just as if it were a Python list. You can use your favorite iterating techniques like foreach loops: `for data, label in train_data` or enumerations: `for i, (data, label) in enumerate(train_data)`. \n",
    "First, let's just grab one batch and break out of the loop."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "[[-0.14732301 -1.32803488]\n",
      " [-0.56128627  0.48301753]\n",
      " [ 0.75564283 -0.12659997]\n",
      " [-0.96057719 -0.96254188]]\n",
      "<NDArray 4x2 @cpu(0)> \n",
      "[ 8.25711536  1.30587864  6.15542459  5.48825312]\n",
      "<NDArray 4 @cpu(0)>\n"
     ]
    }
   ],
   "source": [
    "for i, (data, label) in enumerate(train_data):\n",
    "    print(data, label)\n",
    "    break"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "If we run that same code again you'll notice that we get a different batch. That's because we instructed the `DataLoader` that `shuffle=True`. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "[[-0.59027743 -1.52694809]\n",
      " [-0.00750104  2.68466949]\n",
      " [ 1.50308061  0.54902577]\n",
      " [ 1.69129586  0.32308948]]\n",
      "<NDArray 4x2 @cpu(0)> \n",
      "[ 8.28844357 -5.07566643  5.3666563   6.52408457]\n",
      "<NDArray 4 @cpu(0)>\n"
     ]
    }
   ],
   "source": [
    "for i, (data, label) in enumerate(train_data):\n",
    "    print(data, label)\n",
    "    break"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Finally, if we actually pass over the entire dataset, and count the number of batches, we'll find that there are 2500 batches. We expect this because our dataset has 10,000 examples and we configured the `DataLoader` with a batch size of 4."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2500\n"
     ]
    }
   ],
   "source": [
    "for i, (data, label) in enumerate(train_data):\n",
    "    pass\n",
    "print(i+1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Model parameters\n",
    "\n",
    "Now let's allocate some memory for our parameters and set their initial values. We'll want to initialize these parameters on the `model_ctx`. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "w = nd.random_normal(shape=(num_inputs, num_outputs), ctx=model_ctx)\n",
    "b = nd.random_normal(shape=num_outputs, ctx=model_ctx)\n",
    "params = [w, b]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In the succeeding cells, we're going to update these parameters to better fit our data. This will involve taking the gradient (a multi-dimensional derivative) of some *loss function* with respect to the parameters. We'll update each parameter in the direction that reduces the loss. But first, let's just allocate some memory for each gradient."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "for param in params:\n",
    "    param.attach_grad()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Neural networks\n",
    "\n",
    "Next we'll want to define our model. In this case, we'll be working with linear models, the simplest possible *useful* neural network. To calculate the output of the linear model, we simply multiply a given input with the model's weights (``w``), and add the offset ``b``."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def net(X):\n",
    "    return mx.nd.dot(X, w) + b"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Ok, that was easy."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Loss function\n",
    "\n",
    "Train a model means making it better and better over the course of a period of training. But in order for this goal to make any sense at all, we first need to define what *better* means in the first place. In this case, we'll use the squared distance between our prediction and the true value. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def square_loss(yhat, y): \n",
    "    return nd.mean((yhat - y) ** 2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Optimizer\n",
    "\n",
    "It turns out that linear regression actually has a closed-form solution. However, most interesting models that we'll care about cannot be solved analytically. So we'll solve this problem by stochastic gradient descent. At each step, we'll estimate the gradient of the loss with respect to our weights, using one batch randomly drawn from our dataset. Then, we'll update our parameters a small amount in the direction that reduces the loss. The size of the step is determined by the *learning rate* ``lr``. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def SGD(params, lr):    \n",
    "    for param in params:\n",
    "        param[:] = param - lr * param.grad"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Execute training loop\n",
    "\n",
    "Now that we have all the pieces, we just need to wire them together by writing a training loop. \n",
    "First we'll define ``epochs``, the number of passes to make over the dataset. Then for each pass, we'll iterate through ``train_data``, grabbing batches of examples and their corresponding labels. \n",
    "\n",
    "For each batch, we'll go through the following ritual:\n",
    "     \n",
    "* Generate predictions (``yhat``) and the loss (``loss``) by executing a forward pass through the network.\n",
    "* Calculate gradients by making a backwards pass through the network (``loss.backward()``). \n",
    "* Update the model parameters by invoking our SGD optimizer.",
    "     \n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "24.6606138554\n",
      "9.09776815639\n",
      "3.36058844271\n",
      "1.24549788469\n",
      "0.465710770596\n",
      "0.178157229481\n",
      "0.0721970594548\n",
      "0.0331197250206\n",
      "0.0186954441286\n",
      "0.0133724625537\n"
     ]
    }
   ],
   "source": [
    "epochs = 10\n",
    "learning_rate = .0001\n",
    "num_batches = num_examples/batch_size\n",
    "\n",
    "for e in range(epochs):\n",
    "    cumulative_loss = 0\n",
    "    # inner loop\n",
    "    for i, (data, label) in enumerate(train_data):\n",
    "        data = data.as_in_context(model_ctx)\n",
    "        label = label.as_in_context(model_ctx).reshape((-1, 1))\n",
    "        with autograd.record():\n",
    "            output = net(data)\n",
    "            loss = square_loss(output, label)\n",
    "        loss.backward()\n",
    "        SGD(params, learning_rate)\n",
    "        cumulative_loss += loss.asscalar()\n",
    "    print(cumulative_loss / num_batches)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Visualizing our training progess\n",
    "\n",
    "In the succeeding chapters, we'll introduce more realistic data, fancier models, more complicated loss functions, and more. But the core ideas are the same and the training loop will look remarkably familiar. Because these tutorials are self-contained, you'll get to know this ritual quite well. In addition to updating our model, we'll often want to do some bookkeeping. Among other things, we might want to keep track of training progress and visualize it graphically. We demonstrate one slighly more sophisticated training loop below."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAAEICAYAAABbOlNNAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xt8FPW5+PHPkwRy4SIQEKNIQkWtgoIStZ7Tlp56Q1AR\ntUCNFHtURNqftD32iIfTqlh+x1ZbK79yEVtarKh4QbSWHhVbRduiAqIF1ILcMQTkJgECJHl+f8xs\nMruZve+yu8nzfr32tbuzszPf3Z2dZ753UVWMMcaYgLxMJ8AYY0x2scBgjDEmiAUGY4wxQSwwGGOM\nCWKBwRhjTBALDMYYY4JYYMgwEakQERWRggTf31tEakUkP9VpSwURqRKRV1K9rmlJRL4iIh9nOh1+\nRORrIrI10+mIh4i8LiI3h3lNROS3IrJHRN45xun6k4iMTec+2mxgEJGNInJxptORLFXdrKodVbUh\n1dsWkd+JyE+S2YaqzlPVS1O9bmviHouH3AAfuP0qhvepiPQNPFfVN1X19DSlMeljoZX5MnAJ0EtV\nz0/XTkTkHhF53LtMVS9X1bnp2idAQlepJjuISIGq1rfV/bcyV6rq4kwnojURkfx0XDC5yoGNqnog\nTdvPLFVtkzdgI3BxmNduAdYBu4EXgRPd5QI8BOwAPgf+AfR3XxsKrAH2A9uAO8JsOx94EPgMWA98\nB1CgwC9dwD3A4+7jCnfdm4DNwBLPssD7XwfuA/7qpuUVoLtne98CNgG7gB+F+x6AccBR4AhQC/zB\nk747gQ+AwzgXF5OAT9z9rQFGeLZzI/CW57kC44G1wF5gOiAJrJsP/Nz9HjcA3/V+D7l0i3Is9gXe\nAPa5n3W+u3yJ+3kPuL/PKOBrwNaQ7f7Q/a0OAL8BegJ/cn+rxUBXz/rPANvdfS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0o+nc60uK/9BOeHzwt5T5nn8Qhg\nqc92C3AqsvvQXNnWL2Qd388E9CO48nk9TuVd1G2G+R6SSUsXd/1rfLbp+1ulKR09gHz38RdwTiqB\n3ym08nlopv8HafhfDQHWAD0ynZYE05/QsZutN/dYewz4ZcbTkukExPiFleKUxa8FFnv+vJXArz3r\n/TtOpeo64Nvusg7AcuADnIrOhz0ngyLgGXf9d4AvpDktvQDFqVRa6d5udl/7Hzd97wN/Ab4YZv9D\ncVorfIJTHAAwBbgq2mfCKQr7BPgYTysbv23G+LsklBbgv4EDnu9gJXB8pN8qTem41t3PSpyGAFd6\ntlkJrHK3+SvcUQJa0839PrZ4foNZmU5TAp8hoWM3G2/Al93zwwee3yQjFyQ2JIYxxpggudIqyRhj\nzDFigcEYY0wQCwzGGGOCWGAwxhgTxAKDMcaYIBYYjDHGBLHAYIwxJsj/BzGqsf2PNfcNAAAAAElF\nTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7f92804281d0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Epoch 0, batch 2499. Mean loss: 16.9325145943\n",
      "Epoch 1, batch 2499. Mean loss: 6.24987681103\n",
      "Epoch 2, batch 2499. Mean loss: 2.31109857569\n",
      "Epoch 3, batch 2499. Mean loss: 0.858666448605\n",
      "Epoch 4, batch 2499. Mean loss: 0.323071002489\n",
      "Epoch 5, batch 2499. Mean loss: 0.125603744188\n",
      "Epoch 6, batch 2499. Mean loss: 0.0527891687471\n",
      "Epoch 7, batch 2499. Mean loss: 0.0259436405713\n",
      "Epoch 8, batch 2499. Mean loss: 0.0160523827007\n",
      "Epoch 9, batch 2499. Mean loss: 0.0124009371101\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX4AAAEICAYAAABYoZ8gAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJ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cwPgFLvB7cWuCEZjarq+yLyIvARzj3xHzJvun6yeAzoCLzjNIdFqjoptSaFT4p/\n94mg1WiJpWwwDMNoY6SLq8cwDMOIEyb8hmEYbQwTfsMwjDaGCb9hGEYbw4TfMAyjjWHCbxiG0cYw\n4TcMw2hj/H8d6GtrAUFKvQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7f928051e8d0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "############################################\n",
    "#    Re-initialize parameters because they \n",
    "#    were already trained in the first loop\n",
    "############################################\n",
    "w[:] = nd.random_normal(shape=(num_inputs, num_outputs), ctx=model_ctx)\n",
    "b[:] = nd.random_normal(shape=num_outputs, ctx=model_ctx)\n",
    "\n",
    "############################################\n",
    "#    Script to plot the losses over time\n",
    "############################################\n",
    "def plot(losses, X, sample_size=100):\n",
    "    xs = list(range(len(losses)))\n",
    "    f, (fg1, fg2) = plt.subplots(1, 2)\n",
    "    fg1.set_title('Loss during training')\n",
    "    fg1.plot(xs, losses, '-r')\n",
    "    fg2.set_title('Estimated vs real function')\n",
    "    fg2.plot(X[:sample_size, 1].asnumpy(),\n",
    "             net(X[:sample_size, :]).asnumpy(), 'or', label='Estimated')\n",
    "    fg2.plot(X[:sample_size, 1].asnumpy(),\n",
    "             real_fn(X[:sample_size, :]).asnumpy(), '*g', label='Real')\n",
    "    fg2.legend()\n",
    "\n",
    "    plt.show()\n",
    "\n",
    "learning_rate = .0001\n",
    "losses = []\n",
    "plot(losses, X)\n",
    "\n",
    "for e in range(epochs):\n",
    "    cumulative_loss = 0\n",
    "    for i, (data, label) in enumerate(train_data):\n",
    "        data = data.as_in_context(model_ctx)\n",
    "        label = label.as_in_context(model_ctx).reshape((-1, 1))\n",
    "        with autograd.record():\n",
    "            output = net(data)\n",
    "            loss = square_loss(output, label)\n",
    "        loss.backward()\n",
    "        SGD(params, learning_rate)\n",
    "        cumulative_loss += loss.asscalar()\n",
    "\n",
    "    print(\"Epoch %s, batch %s. Mean loss: %s\" % (e, i, cumulative_loss/num_batches))\n",
    "    losses.append(cumulative_loss/num_batches)\n",
    "            \n",
    "plot(losses, X)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Conclusion \n",
    "\n",
    "You've seen that using just mxnet.ndarray and mxnet.autograd, we can build statistical models from scratch. In the following tutorials, we'll build on this foundation, introducing the basic ideas behind modern neural networks and demonstrating the powerful abstractions in MXNet's `gluon` package for building complex models with little code. "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Next\n",
    "[Linear regression with gluon](../chapter02_supervised-learning/linear-regression-gluon.ipynb)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "For whinges or inquiries, [open an issue on  GitHub.](https://github.com/zackchase/mxnet-the-straight-dope)"
   ]
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.4.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
